// Copyright (c) Appeon. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. 
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

using System.Collections.Generic;

namespace SnapObjects.Data
{
    /// <summary>
    ///     Represents the search condition in a SQL statement. It is the base interface of ISqlWhereCondition, 
    ///     ISqlJoinCondition, and ISqlHavingCondition.
    /// </summary>
    public interface ISqlConditionBuilder
    {
        /// <summary>
        ///     Returns the raw SQL string for the current search condition in the corresponding database.
        /// </summary>
        /// <param name="context">A DataContext object which contains the database connection information.</param>
        /// <returns>Returns the raw SQL string.</returns>
        string ToSqlString(DataContext context);

        /// <summary>
        ///     Gets an IReadOnlyDictionary<string, ISqlParameter> object that contains all of the parameters 
        ///     used in the current search condition.
        /// </summary>
        IReadOnlyDictionary<string, ISqlParameter> UsedParameters { get; }
    }
}
